//  * 这好像就是一道基础的算法 滑动窗口，双指针的加强版本就是这样的

#include <iostream>
#include <algorithm>
#include <string>

// using namespace std;

const int N = 1e7 + 10;
int a[N];

int n, x;
int left = 1, right = 0;
int temp = 0, len = 1e7 + 10;
int lret, rret;

void update()
{
    if (len > (right - left + 1))
    {
        len = right - left + 1;
        lret = left, rret = right;
    }
}

int main()
{
    std::cin >> n >> x;
    for (int i = 1; i <= n; i++)
    {
        std::cin >> a[i];
    }
    // 定义两个窗口指针

    while (right <= n)
    {
        temp += a[++right];

        while (left < right && temp >= x)
        {
            update();
            temp -= a[left++];
        }
    }

    std::cout << lret << " " << rret << std::endl;
    return 0;
}